(bug 13768) Handling case-insensitivity of pt_title in prop=info
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 17 Apr 2008 12:58:20 +0000 (12:58 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 17 Apr 2008 12:58:20 +0000 (12:58 +0000)
RELEASE-NOTES
includes/api/ApiQueryInfo.php

index 9a9cbb4..6ddf2bd 100644 (file)
@@ -238,6 +238,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 13544) Added oldid parameter to action=parse to allow for parsing of old revisions
 * (bug 13718) Return the proper continue parameter for cmsort=timestamp
 * action=login now returns the correct waiting time in the details property
+* (bug 13768) inprop=protection now honors case-insensitivity for protected titles
 
 === Languages updated in 1.13 ===
 
index adc8449..ef07e94 100644 (file)
@@ -116,7 +116,8 @@ class ApiQueryInfo extends ApiQueryBase {
                        $res = $this->select(__METHOD__);
                        $prottitles = array();
                        while($row = $db->fetchObject($res)) {
-                               $prottitles[$row->pt_namespace][$row->pt_title] = array(
+                               // Argh, pt_title is case-insensitive
+                               $prottitles[$row->pt_namespace][strtolower($row->pt_title)] = array(
                                        'type' => 'create',
                                        'level' => $row->pt_create_perm,
                                        'expiry' => Block::decodeExpiry($row->pt_expiry, TS_ISO_8601)
@@ -249,8 +250,8 @@ class ApiQueryInfo extends ApiQueryBase {
                                {
                                        // Apparently the XML formatting code doesn't like array(null)
                                        // This is painful to fix, so we'll just work around it
-                                       if(isset($prottitles[$title->getNamespace()][$title->getDBkey()]))
-                                               $res['query']['pages'][$pageid]['protection'][] = $prottitles[$title->getNamespace()][$title->getDBkey()];
+                                       if(isset($prottitles[$title->getNamespace()][strtolower($title->getDBkey())]))
+                                               $res['query']['pages'][$pageid]['protection'][] = $prottitles[$title->getNamespace()][strtolower($title->getDBkey())];
                                        else
                                                $res['query']['pages'][$pageid]['protection'] = array();
                                        $result->setIndexedTagName($res['query']['pages'][$pageid]['protection'], 'pr');